package com.jdaoyun;


import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jdaoyun.a_preAid.entity.AidOrderambulance;
import com.jdaoyun.a_preAid.entity.XctiCallrecord;
import com.jdaoyun.a_preAid.mapper.AidOrderMapper;
import com.jdaoyun.a_preAid.mapper.AidOrderambulanceMapper;
import com.jdaoyun.a_preAid.mapper.XctiCallrecordMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest
public class test {


    @Autowired
    private AidOrderMapper orderMapper;//受理单表

    @Autowired
    private AidOrderambulanceMapper orderambulanceMapper;//派车单表

    @Test
    public void test() {
    	 //41
        AidOrderambulance aidOrderambulance = orderambulanceMapper.selectById(41);
        String format = DateUtil.format(aidOrderambulance.getCreateTime(), "yyyy-MM-dd HH:mm:ss");

        System.out.println(format);
    }

    @Autowired
    private XctiCallrecordMapper xctiCallrecordMapper;//xcti通话记录
    @Test
    public void test1() {
        AidOrderambulance aidOrderambulance = orderambulanceMapper.selectById(41);
        DateTime dateTime = DateUtil.offsetSecond(new Date(), -5);
        long between = DateUtil.between(aidOrderambulance.getCreateTime(), dateTime, DateUnit.SECOND);
        //betweenlong变字符串
        String s = String.valueOf(between);


        String result = "" + between;
        DateUnit minute = DateUnit.MINUTE;
        System.out.println(result);
        System.out.println(s);
        System.out.println(between);
    }

}
